package com.wu.cloud.custom.util;

import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.Set;

/**
 * @author xwu36
 */
@Component
public class HttpComponent {

    public String mapToParam(Map<String, Object> params) {
        Set<String> keySet = params.keySet();
        StringBuffer buffer = new StringBuffer();
        for (String key : keySet) {
            buffer.append(key).append("=").append(params.get(key).toString()).append("&");
        }
        return buffer.toString().substring(0, buffer.toString().length() - 1);
    }
}
